<?php 
require_once("abstractdatabase.php");
class project extends MsssqlDB 
{
	private $sqlquery;
	
	public function __construct()
	{
		 parent::__construct("mssql.infratechastm.com","infratechastm_dede","system1","infratechastm_Mockup");
	}
	
	public function addnewlocaltion($input)
	{
				
		$this->sqlquery = $this->insertdatasql("name_local,project,databasename","localtionpz",$input);
		$this->mssqlclose();
		//echo $input;
		return $this->sqlquery;
		
		
	}
	
	
	public function viewallproject()
	{
		$this->sqlquery = $this->msssqlselectdata("*","Project","pkProject <> '1'");
		//
		return $this->sqlquery;
		
	}
		
	public function viewedlocaltion($id_local)
	{
		
			$query = $this->selectdatasql("*","localtionpz","id_local = '$id_local'");
			$this->sqlquery = $this->mysqlfetcharray($query);
			
			return $this->sqlquery;
	}
	
	
	public function editdatalocal($name,$local,$pointdata)
	{
		$feld ="name_local = $name ,project = $local";

		$this->sqlquery = $this->updatedatasql("localtionpz",$feld,"id_local = $pointdata");
		
		return $this->sqlquery;
		}
		
	
	
	
	
	public function data($tablenamecsv)
		{
							$this->nametable = mysql_real_escape_string($tablenamecsv);
					
							
							 $sql = "CREATE TABLE $this->nametable (
							`Id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,                                
							`measureddate` VARCHAR( 50 ) NOT NULL ,        
							                        
							`time` DATE NOT NULL ,    
							                            
							`pz01a` VARCHAR( 255 )  NULL ,    
							`pz01b` VARCHAR( 255 )  NULL ,       
							`pz02a` VARCHAR( 255 )  NULL ,    
							`pz02b` VARCHAR( 255 )  NULL ,  
							`pz03a` VARCHAR( 255 )  NULL ,    
							`pz03b` VARCHAR( 255 )  NULL ,  
							`pz04a` VARCHAR( 255 )  NULL ,    
							`pz04b` VARCHAR( 255 )  NULL ,
							
							`pz05a` VARCHAR( 255 )  NULL ,    
							`pz05b` VARCHAR( 255 )  NULL ,       
							`pz06a` VARCHAR( 255 )  NULL ,    
							`pz06b` VARCHAR( 255 )  NULL ,  
							`pz07a` VARCHAR( 255 )  NULL ,    
							`pz07b` VARCHAR( 255 )  NULL ,  
							`pz08a` VARCHAR( 255 )  NULL ,    
							`pz08b` VARCHAR( 255 )  NULL ,
							
							
							`pz09a` VARCHAR( 255 )  NULL ,    
							`pz09b` VARCHAR( 255 )  NULL ,       
							`pz10a` VARCHAR( 255 )  NULL ,    
							`pz10b` VARCHAR( 255 )  NULL ,  
							`pz11a` VARCHAR( 255 )  NULL ,    
							`pz11b` VARCHAR( 255 )  NULL ,  
							`pz12a` VARCHAR( 255 )  NULL ,    
							`pz12b` VARCHAR( 255 )  NULL ,
							
							`pz13a` VARCHAR( 255 )  NULL ,    
							`pz13b` VARCHAR( 255 )  NULL ,       
							`pz14a` VARCHAR( 255 )  NULL ,    
							`pz14b` VARCHAR( 255 )  NULL ,  
							`pz15a` VARCHAR( 255 )  NULL ,    
							`pz15b` VARCHAR( 255 )  NULL , 
							`pz16a` VARCHAR( 255 )  NULL ,    
							`pz16b` VARCHAR( 255 )  NULL ,
							`pz17a` VARCHAR( 255 )  NULL ,    
							`pz17b` VARCHAR( 255 )  NULL , 
							`pz18a` VARCHAR( 255 )  NULL ,    
							`pz18b` VARCHAR( 255 )  NULL 
                  
							)";
											
							$query = mysql_query($sql);
						
							if(mysql_errno() > 0)  die (mysql_error());
							if(!$query)
							{
								return false;
								
								}else{
									
								return true;	
							}
							
			}
	
	
	
	
	
	
	}
	
	
	
	
	
	

?>